home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Dots & Pixels
/
Rudimentary Documentation
/
Class descriptions.note
next >
Wrap
Text File
|
1995-09-29
|
6KB
|
116 lines
classes defined in 'Mac Interface µ':
==
== Macintosh specific classes:
== (need a 8 bit display where successive pixels on every row of the screen
== can be memory addressed in successive byte positions)
==
Classs name Contents and intended use:
==
== Minimal Mac interface classes (do not follow Apple Human Interface GuideLines):
==
application Quick hack which initializes the toolbox for you
depthchange a quick and dirty way to switch bit-depths on monitor
port color grafport
window for non-movable windows on a Macintosh screen
fullscreen fullscreen windows, hide the menu bar and can switch depth
gworld offscreen gworlds, extended with some member functions
for the generation of random pixel arrays
soundchannel simple way to generate beeps of various frequencies and durations
stopwatch simple interface to the extended time manager
vretrace simplest way I know of to use VBLs. Note: this code needs
a resource of type 'VBL ', #128 to be present. This resource
should contain the VBL code, and should have the Locked and
System bits set. The code for the resource can be found in
'vretrace.c', the ResEdit file 'VBL.rsrc' contains a compiled
version.
==
== Classes for the creation of random dot displays:
==
screenarea A part of the screen, which is 2^n x 2^n pixels in size.
Addressable as a two-dimensional array.
Allows for some rows to lie outside the screen
screendots A collection of dots on a screenarea, displayed using
a fixed 'difference color'. Dots are represented by the screen
address one needs to write to to set or clear them, so that
these do not have to be recalculated from the dot positions
(stored in a dotcollection) when erasing earlier set dots.
This is a virtual base class; a subclass of it must specify
which screen addresses to write to by overriding
'void compute_addresses()'. Subclass of screenarea.
dotcollection A collection of 2D dot positions at 16 bit accuracy. Used to
remember the positions of individual dots in 2D space, for
instance to be able to displace a collection of dots according
to a certain optic flow.
phaser Used to implement limited-lifetime stimuli. Specifically, it can
be used to treat a stimulus of a large number of dots as n
interwoven stimuli with the specified lifetime = frequency, but
differing phases (e.g. a 300 dot stimulus in which 100 dots are
replaced at every timestep, giving a dot lifetime of 3)
noisedots Subclass of screendots which generates spatio-temporal white
(am not 100% sure whether that term is appropiate here) noise.
Free parameters are the number of dots and their lifetime.
The dots initially are uniformly distributed on the screenarea,
and number_of_dots / lifetime dots are given a new position at
every timestep. The new positions are drawn from a uniform
distribution.
movingnoisedots Subclass of screendots which generates spatio-temporal noise.
Free parameters are the number of dots, their lifetime, and their
'diffusion constant'.
The dots initially are uniformly distributed on the screenarea,
and number_of_dots / lifetime dots are given a new position at
every timestep. The new positions are drawn from all positions
in a square of size indicated by the 'diffusion constant' around
the old position. Thus the dots move at a user-specifiable speed,
but in a randomly varying direction. If this movement moves the
dot outside the screenarea it is given a new position drawn from a
uniform distribution on the entire screenarea. Every lifetime
timesteps the dot is given a new position drawn from an uniform
distribution, regardless of whether it is moved outside of the
screenarea.
This implies that setting lifetime to one makes 'movingnoisedots'
equal to 'noisedots' with lifetime 1, and setting the diffusion
constant to zero makes 'movingnoisedots' with lifetime n equal to
'noisedots' with lifetime n.
Implementation note: the square around the old position is not
completely symmetric (we use a n-bit signed binary number for it)
Thus, a slight drift is present in every instance of movingnoisedots
However, the drift really slight; on average 1/65536 unit per
stimulus frame in dotcollection coordinates. This corresponds to
1/128 or 1/256 pixel per stimulus frame in a 512x512 resp. 256x256
pixel stimulus. Even at 90 stimulus frames per second (i.e. screen
refresh rate for a fast monitor) that boils down to less than a
pixel per second. At 72 pixels/inch (i.e. screen resolution of a
not-so-good monitor) that is 1/72"/s which is less than 0.4 mm/s,
or to less than 0.08°/s (5 arc minute /s) at a viewing distance
of 30cm.
scrolling_noise used to create simple scrolling random Pixel arrays
stereopair a pair of gworld's, can be used to built red-green stereograms
flowdots Subclass of screendots which generates flow patterns.
Free parameters are the number of dots, their lifetime, and the
flow according to which they move. The flow can be varied by
calling appropiate member functions.
The dots initially are uniformly distributed on the screenarea,
and number_of_dots / lifetime dots are given a new position at
every timestep. The other dots move according to the optic flow
specified. Any dot thus moving outside of the screenarea and the
dots to be replaced are given a new position drawn from a uniform
distribution on the entire screenarea.